﻿@model IEnumerable<Common.Type.TreeViewNode>
@* ===============================================================
    Creator: HieuNK
    Date   : 2014/02/18
    Purpose: Partial view - Create the submenu when know the parent *@
@if (Model != null && Model.Count() > 0)
{
    <ul>
        @foreach (var menuitem in Model)
        {
            <li>
                @if (menuitem.Nodes != null && menuitem.Nodes.Count > 0)
                {
                    <a class="dropmenu">
                        @if (!string.IsNullOrEmpty(menuitem.CssIcon))
                        {<i class="@menuitem.CssIcon"></i>}<span class="hidden-tablet">@menuitem.Value</span>
                    </a>
                    @Html.Partial("_Submenu", menuitem.Nodes)
                }
                else
                {
                    if (string.IsNullOrEmpty(menuitem.Url))
                    {
                        <a class="submenu">
                            @if (!string.IsNullOrEmpty(menuitem.CssIcon)){<i class="@menuitem.CssIcon"></i>}<span class="hidden-tablet">@menuitem.Value</span>
                        </a>
                    }
                    else
                    {
                        <a class="submenu" href="@menuitem.Url">@if (!string.IsNullOrEmpty(menuitem.CssIcon)){<i class="@menuitem.CssIcon"></i>}<span class="hidden-tablet">@menuitem.Value</span></a>
                    }
                }
            </li>
        }
    </ul>
}
